package com.guldan.jaina.utils;

import com.guldan.core.utils.DateUtil;
import com.guldan.jaina.dto.projectregisterbatch.ProjectRegisterBatchDTO;
import com.guldan.mapper.db.entity.ProjectRegisterBatch;

/**
 * Created by Silas.
 * Date: 2016/12/3
 * Time: 16:21
 */
public class ProjectRegisterBatchDomainConvertUtils {

    public static ProjectRegisterBatchDTO convert(ProjectRegisterBatch entity) {
        ProjectRegisterBatchDTO dto = new ProjectRegisterBatchDTO();

        dto.setBatchId(entity.getBatchId());
        dto.setProjectId(entity.getProjectId());
        dto.setProjectName(entity.getProjectName());
        dto.setYear(entity.getYear());
        dto.setPayCycleCode(entity.getPayCycleCode());
        dto.setSubsidyCount(entity.getSubsidyCount());
        dto.setPayObjCode(entity.getPayObjCode());
        dto.setState(entity.getState());
        dto.setAreaId(entity.getAreaId());
        dto.setAreaName(entity.getAreaName());
        dto.setFailReason(entity.getFailReason());
        dto.setCreatorAreaId(entity.getCreatorAreaId());
        dto.setCreatorUserType(entity.getCreatorUserType());

        dto.setCreateTime(DateUtil.toLocaleString(entity.getCreateTime(), DateUtil.YYYY_MM_DD_HH_DD_SS));
        dto.setCreator(entity.getCreator());
        dto.setDelete(entity.getIsDelete());
        dto.setDisabled(entity.getDisabled());
        dto.setModifier(entity.getModifier());
        dto.setModifyTime(DateUtil.toLocaleString(entity.getModifyTime(), DateUtil.YYYY_MM_DD_HH_DD_SS));

        return dto;
    }
}
